* support parallel vtesto from qmake.
also support testo, vtesto with out of source builds.
* force check to run.
QMAKE_CFLAGS_WARN_ON -= -W
QMAKE_CXXFLAGS_WARN_ON -= -W
-macx|linux|openbsd{
- check.commands = PNAME=./$(TARGET) ./testo
- check.depends = $(TARGET)
- QMAKE_EXTRA_TARGETS += check
-}
+check.depends = $(TARGET) FORCE
+check.commands = @PNAME=./$(TARGET) $${PWD}/testo
+QMAKE_EXTRA_TARGETS += check
+
+check-vtesto.depends = $(TARGET) FORCE
+check-vtesto.commands += @$(MAKE) -s -f $${PWD}/Makefile_vtesto srcdir=$${PWD} builddir=$${OUT_PWD} check-vtesto
+QMAKE_EXTRA_TARGETS += check-vtesto
+QMAKE_CLEAN += $${OUT_PWD}/testo.d/*.vglog
# build the compilation data base used by clang tools including clang-tidy.
macx|linux|openbsd{
--- /dev/null
+#
+# Legacy makefile hook for GPSBabel.pro
+# This lets us determine the tests when make is run instead
+# of when qmake is run.
+# The make parallel execution feature can be used.
+#
+# GPSBabel requires a reasonably recent version of GNU Make.
+# We rely on very few fancy features of make so the exact version
+# probably doesn't much matter. GNU Make 3.81 seems a reasonable target.
+#
+
+srcdir = .
+builddir = .
+
+TESTCASES := $(sort $(wildcard $(srcdir)/testo.d/*.test))
+VGLOGS := $(addprefix $(builddir)/testo.d/, $(addsuffix .vglog, $(basename $(notdir $(TESTCASES)))))
+
+%.vglog: FORCE
+ @mkdir -p $(builddir)/testo.d
+ @$(srcdir)/vtesto -l -j $@ $(basename $(notdir $@))
+
+# Declaring a target PHONY whose names matches a subdirectory can be
+# particularly important, e.g. gui.
+.PHONY: all clean check-vtesto
+
+all: check-vtesto
+
+clean:
+ rm -f $(VGLOGS)
+
+check-vtesto:
+ @$(MAKE) -f $(srcdir)/Makefile_vtesto $(VGLOGS)
+
+FORCE:
#include "defs.h"
#include "gbfile.h"
#include <QtCore/QDebug>
+#include <QtCore/QFileInfo>
#define MYNAME "f90g_track"
#define TTRECORDSIZE 249
// start the track list
track = new route_head;
is_fatal((track == nullptr), MYNAME ": memory non-enough");
- track->rte_name = fname;
+ track->rte_name = QFileInfo(fname).fileName();
track_add_head(track);
}
}
-Cannot open './reference/doesnotexist' for read. Error was 'No such file or directory'.
+Cannot open 'doesnotexist' for read. Error was 'No such file or directory'.
-Cannot open './reference/doesnotexist' for read. Error was 'The system cannot find the file specified.'.
+Cannot open 'doesnotexist' for read. Error was 'The system cannot find the file specified.'.
<time>1970-01-01T00:00:00Z</time>
<bounds minlat="40.804915000" minlon="-124.126895000" maxlat="40.847798333" maxlon="-124.082008333"/>
<trk>
- <name>./reference/track/f90g-sample.map</name>
+ <name>f90g-sample.map</name>
<trkseg>
<trkpt lat="40.847798333" lon="-124.082008333">
<time>2014-04-27T17:39:52Z</time>
#define SRC_CORE_FILE_INCLUDED_H_
#include <QtCore/QFile>
+#include <QtCore/QFileInfo>
#include <QtCore/QIODevice>
#include <cstdio>
#include "defs.h"
if (!status) {
fatal("Cannot open '%s' for %s. Error was '%s'.\n",
- qPrintable(QFile::fileName()),
+ gpsbabel_testmode()? qPrintable(QFileInfo(*this).fileName()) : qPrintable(QFile::fileName()),
(mode & QIODevice::WriteOnly)? "write" : "read",
qPrintable(QFile::errorString()));
}
while [ $# -ge 1 ];
do
t=${BASEPATH}/testo.d/$1.test
- echo Running $t
+ echo Running `basename $t`
. $t
shift;
done
else
for i in ${BASEPATH}/testo.d/*.test
do
- echo Running $i
+ echo Running `basename $i`
. $i
done
fi
${PNAME} -i xol -f ${REFERENCE}/doesnotexist -o gpx -F ${TMPDIR}/xol-sample_si.gpx 2> ${TMPDIR}/nonexistent.err && {
echo "${PNAME} succeeded! (it shouldn't have with this input...)"
}
-# check error message is what we expected
-# Note that the reference file nonexistent.err includes the file path,
-# so this will fail when starting from a directory other than gpsbabel.
-# the message can vary depending on the c runtime, .i.e. msvc and gcc are slightly different.
+# check error message is what we expected.
+# The message can vary depending on the c runtime, .i.e. msvc and gcc are slightly different.
compare_with_alternate ${REFERENCE}/nonexistent.err ${REFERENCE}/nonexistent_alternate.err ${TMPDIR}/nonexistent.err